﻿using RTW.Core.Datas;
using RTW.Core.Ioc;
using RTW.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace RTW.Servers
{
    public class TLogServer : BaseDAL<TLog>, IAutoInject
    {
        public List<TLog> GetLogsByUser(string userID)
        {
            return DbType.DB().Select<TLog>().Limit(5)
                     .LeftJoin(a => a.User.ID == a.UserID)
                     .LeftJoin(a => a.User.DM.ID == a.DMID)
                     .Where(m => (m.UserID == userID ))
                     .OrderByDescending(m => m.AddTime)
                     .ToList<TLog>(); ;
        }
    }
}
